import AppConfig from "../config/AppConfig";

export default class LocalStore {
    static setItem(key: string, value: any) {
        cc.sys.localStorage.setItem(this._genKey(key), value);
    }

    static getItem(key: string) {
        return cc.sys.localStorage.getItem(this._genKey(key));
    }

    private static _genKey(key: string){
        let appName = AppConfig.appName;
        let appId = AppConfig.appIdList[AppConfig.platformId];
        let genKey = `${appName}_${appId}_${key}`;
        return genKey;
    }
}
